<template>
  <view class="question">
    <view class="text">
      {{
        this.content == ""
          ? '"奇葩男公交车上强脱老人鞋猛吸，闻完后淡定归还，乘客目瞪口呆"'
          : content[num].title
      }}</view
    >
    <view></view>
    <view style="width: 100%">
      <video
        class="video"
        :src="
          this.content == ''
            ? 'https://v.9liuda.com/movies/202102/07/c58f122446c273bb34aed8a836b7c0e2?sign=1612807199-rjv3d9f9-0-50338aac912b17f34711435d12601383'
            : this.content[num].video
        "
        :poster="
          this.content == ''
            ? 'http://images-video.9liuda.com/images/202102/07/0fc21c47b3cdb93e75fac5f9d78991d2?imageMogr2/auto-orient/interlace/1/format/jpg/thumbnail/500x/size-limit/$(fsize)'
            : this.content[num].videoImage
        "
      ></video>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      content: "",
      num: "",
    };
  },
  onShow() {
    let num = Math.floor(Math.random() * 20);
    this.num = num;
    let content = uni.getStorageSync("content");
    if (content) {
      this.content = content;
    }
  },
  onHide() {
	this.content=[];
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.question {
  width: 100%;
  // margin-left: 4%;
  display: flex;
  flex-wrap: wrap;
  // justify-content: center;
  margin-bottom: 100upx;
  .text {
    margin: 4% 0 3% 4%;
  }
  .video {
    width: 100%;
  }
}
</style>

